package ks.client.controllers;

import ks.client.gui.UMGUI3;
import ks.managers.user.User;
import ks.client.gui.models.UserModel;


/**
 * Add a user to the model.
 * 
 * @author GregJOverton
 */
public class AddUserController {
	/** GUI being managed. */
	UMGUI3 umg;
	
	public AddUserController(UMGUI3 umg) {
		this.umg = umg;
	}

	public boolean add(User u) {	

		// update the underlying model.
		UserModel userModel = umg.getModel();
		if(!userModel.add(u))
			return false;
		
		// make change visible.
		return umg.refreshTable();
	}

}
